//JQuery extension for controllers
$.extend({
	createControllers: function() {//Initialize controllers
		$.createAjaxParamController();
		$.createAccountController();
	},
	createAjaxParamController: function() {
		Accounting.ajaxParamController = Ember.Object.create({
			newParam: function() {
				return Accounting.SecureRequestParam.create({
					criteria: null,
					expensTransaction: null,
					//fbCode: $fbCode,
					fbCode: null,
					incomeTransaction: null,
					transferTransaction: null,
					weeklyBalanceUpdates: null,
					year: null
				});
			}
		});
	},
	createAccountController: function() {
		Accounting.accountController = Ember.Object.create({
			content: [],
			loadAccounts: function(accountList) {
				var accounts = new Array();
				accountList.forEach(function(item, index, self) {
					accounts[accounts.length] = Accounting.Account.create(item);
				});
				this.content = accounts;
			}
		});
	}
});